package cn.iocoder.yudao.module.member.dal.mysql.userpackagedetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.userpackagedetail.UserPackageDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.userpackagedetail.vo.*;

/**
 * 用户套餐购买明细 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserPackageDetailMapper extends BaseMapperX<UserPackageDetailDO> {

    default PageResult<UserPackageDetailDO> selectPage(UserPackageDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserPackageDetailDO>()
                .betweenIfPresent(UserPackageDetailDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserPackageDetailDO::getPackageUsedId, reqVO.getPackageUsedId())
                .eqIfPresent(UserPackageDetailDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(UserPackageDetailDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(UserPackageDetailDO::getBuyTime, reqVO.getBuyTime())
                .eqIfPresent(UserPackageDetailDO::getBuyMoney, reqVO.getBuyMoney())
                .eqIfPresent(UserPackageDetailDO::getButType, reqVO.getButType())
                .orderByDesc(UserPackageDetailDO::getId));
    }

}